//
//  RedView.m
//  事件的产生与传递应用一
//
//  Created by hyl on 16/6/19.
//  Copyright © 2016年 hyl. All rights reserved.
//

#import "RedView.h"

@interface RedView ()
@property (nonatomic,weak) IBOutlet UIButton *btn;
@end

@implementation RedView


-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
    //转换点
    CGPoint p=[self convertPoint:point toView:self.btn];
    if ([self.btn pointInside:p withEvent:event]==YES) {
        return self.btn;
    }else{
        return [super hitTest:point withEvent:event];
    }
}
@end
